use serde::{Deserialize, Serialize};
use utoipa::{IntoParams, ToSchema};

#[derive(Debug, ToSchema, Deserialize, Serialize, IntoParams)]
pub struct EmployeeLoginDtO {
    pub username: String,
    pub password: String,
}

#[derive(Debug, ToSchema, Deserialize, Serialize, IntoParams)]
pub struct EmployeeDTO {
    pub id: Option<i64>,
    pub username: String,
    pub name: String,
    pub phone: String,
    pub sex: String,
    pub id_number: String,
    pub password: String,
}

pub struct EmployeeStatusDTO {
    pub id: i64,
    pub status: i32,
}

#[derive(Debug, ToSchema, Deserialize, Serialize, IntoParams)]
#[serde(rename_all = "camelCase")]
pub struct EmployeePassDTO {
    pub emp_id: i64,
    pub new_password: String,
    pub old_password: String,
}

#[derive(Debug, ToSchema, Deserialize, Serialize, IntoParams)]
#[serde(rename_all = "camelCase")]
pub struct EmployeePageQueryDTO {
    // 员工姓名
    pub name: Option<String>, // 使用 `Option` 表示字段可能为空
    pub id: Option<i64>,
    // 页码
    pub page: usize,
    // 每页显示记录数
    pub page_size: usize,
}
